<template>
  <div class="feedback-box">
    <div class="img-box">
      <img src="../../assets/image/decorate.png" alt />
    </div>
    <div class="input-div">
      <textarea v-model="text" maxlength="400" placeholder="欢迎对我们提出意见和建议，您的每一个字对我们都是最宝贵的财富"></textarea>
    </div>
    <div class="bottom-box" @click="sendFeedBack">
      <button>告诉我们</button>
    </div>
  </div>
</template>

<script>
import { addFeedBack } from "api/User"
export default {
    name:"FeedBack",
    data() {
        return {
            text: ''
        }
    },
    methods: {
        sendFeedBack() {
            addFeedBack({ content: this.text,  sourceType: 1 }).then(({ code, message }) => {
                if (!code) {
                    this.$toast("您的反馈我们已收到！");
                    this.$router.go(-1);
                } else {
                    this.$toast(message);
                }
            })
        }
    }
};
</script>

<style lang="stylus" scoped>
@import '../../assets/styl/mixin.styl'
.img-box
  width 100%
  height rem(130)
  img
    width 100%
    height 100%
.input-div
  textarea
    height rem(200)
    width 100%
    border none
    box-sizing border-box
    padding rem(20)
    line-height rem(18)
.bottom-box
  margin rem(68) auto
  display flex
  justify-content center
  button
    width rem(345)
    height rem(49)
    border-radius rem(5)
    color white
    font-size rem(16)
    text-align center
    background $baseColor
</style>